package converter;

import java.util.Map;

import model.Operator;
import model.Task;

import org.apache.struts2.util.StrutsTypeConverter;

import persistency.TaskRepository;

public class TaskConverter  extends StrutsTypeConverter{

	
	    public Object convertFromString(Map context, String[] values, Class toClass) {
			TaskRepository tr = new TaskRepository();
			return tr.getById(new Integer(values[0]));
	    	
	       
	    }

	    public String convertToString(Map context, Object o) {
			Task t =(Task)o;
			return ""+t.getTaskId();
	      
	    }
	
	
	
}
